﻿CREATE proc doipass    
@UserName as varchar(30),    
@PWD as nvarchar(50),    
@PWDN as nvarchar(50)    
as    
declare @ID as bigint    
if(exists(select * from DanhMuc_NguoiDung Where MaNV=@UserName and MatKhau=cast(@PWD as varbinary(50)))  )  
begin    

update DanhMuc_NguoiDung set MatKhau=CAST(@PWDN as varbinary(50)) Where MaNV=@UserName  
select ErrCode=1  
end    
else    
begin    
select ErrCode=0    
end